Skip to content

[Feature/sat] Satellite prediction#879

Draft
MichaelWheeley wants to merge 23 commits intoaccius:Stagingfrom
MichaelWheeley:feature/sat_predict_dev2
Draft

[Feature/sat] Satellite prediction#879
MichaelWheeley wants to merge 23 commits intoaccius:Stagingfrom
MichaelWheeley:feature/sat_predict_dev2

Conversation

@MichaelWheeley
Copy link
Copy Markdown
Contributor

@MichaelWheeley MichaelWheeley commented Apr 5, 2026

What does this PR do?

  • Adds satellite prediction modal.
  • Modal refreshes every 60sec.
  • Fixes problem with inability to scroll satellite details window.
  • SatelliteOrbit.js is imported with very minor modification from satvis project, MIT license.
  • PR may have dependency on [Feature/satellite] styling visibility - other updates #877 which should be reviewed first.

Type of change

  • Bug fix
  • New feature
  • Performance improvement
  • Refactor / code cleanup
  • Documentation
  • Translation
  • Map layer plugin

How to test

  1. select many satellites in the details window such that it overflows the window - it should now be possible to mouse scroll up and down.
  2. From the satellite details window choose the name of any listed satellite, it will open a modal dialog showing satellite prediction for the next 7 days. Press close or escape key to exit the modal.
  3. Change the minimum elevation [deg] in the settings -> satellite menu, e.g. set it to some quite high like 70 degrees, then go back and open a new modal. Only those passes where the minimum is reached are shown, and the duration of the passes (that is the duration above the minimum threshold) will be shorter.
  4. Leave the modal open, the times in the time from now column will decrement each minute.

Checklist

  • App loads without console errors
  • Tested in Dark, Light, and Retro themes
  • Responsive at different screen sizes (desktop + mobile)
  • If touching server.js: caches have TTLs and size caps (we serve 2,000+ concurrent users)
  • If adding an API route: includes caching and error handling
  • If adding a panel: wired into Modern, Classic, and Dockable layouts
  • No hardcoded colors — uses CSS variables (var(--accent-cyan), etc.)
  • No .bak, .old, console.log debug lines, or test scripts included

Screenshots (if visual change)

with many satellites in the window it should now be possible to mouse scroll up and down
image

each satellite listed is now a button - press it to get a prediction modal
image

image

@MichaelWheeley MichaelWheeley marked this pull request as ready for review April 5, 2026 05:11
Copy link
Copy Markdown
Owner

@accius accius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good progress on satellite prediction — the pass table and auto-refresh are nice additions. A few things to address:

Must fix

XSS risk in onclick handler — Satellite names and TLE lines are injected unescaped into an inline onclick:

onclick="openSatellitePredict('${sat.name}', '${sat.tle1}', '${sat.tle2}')"

A satellite name containing ' breaks the handler; malicious content is injectable. Use data- attributes with a delegated event listener, or escape the values.

Interval leakwindow.satellitePredictInterval is overwritten if a second modal opens before the first interval fires. The old interval keeps running. Clear the previous one before assigning:

if (window.satellitePredictInterval) clearInterval(window.satellitePredictInterval);

Carries all #877 issues — This PR includes #877's commits, so the hardcoded colors, broken nested <table> HTML, duplicate style attribute, and valueAsNumber ?? fallback bugs all apply here too. Fix those in #877 first.

Should fix

Commented-out code — Large blocks in useSatelliteLayer.js (~30 lines) are commented out rather than removed. Either delete them now or open an issue to track it — don't ship dead code in comments.

Hardcoded button colorsbackground: #440000; border: 1px solid #ff4444 on the satellite name button won't work in Light/Retro themes. Use CSS variables.

Worth discussing

dayjs dependency — Does the project already have date utilities that could handle the format() and diff() calls? Adding a new dependency for a few date operations adds bundle weight. Not a blocker if the team is fine with it.

60s full recomputation — The interval recomputes all orbital passes every minute. Since pass times only shift meaningfully over hours, you could just update the "from now" column without rerunning the orbital math.

…ed legacy code since satellite location calculations are now done as a hook in useSatellites.js
…no longer updated unless modal is reopened or if 'satellites' is updated. Display Time From Now as hours:minutes:seconds
@MichaelWheeley MichaelWheeley marked this pull request as draft April 6, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants